package cheme.ProcessModel.Cmds;

import org.eclipse.draw2d.geometry.Point;
import org.eclipse.gef.commands.Command;

import cheme.ProcessModel.ProcessUnits.Streams.IStream;


public class DeleteStreamBendpointCmd extends Command
{
	private IStream stream;

	private Point oldLocation;

	private int index;

	public void execute()
	{
		oldLocation = stream.getBendpoints().get(index);
		stream.removeBendpoint(index);
	}

	public void setStream(IStream connection)
	{
		this.stream = connection;
	}

	public void setIndex(int i)
	{
		index = i;
	}

	public void undo()
	{
		stream.addBendpoint(index, oldLocation);
	}
}
